package com.Xingcang_Dianxue.WhutBank.Models;

import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public abstract class Account {
    private final StringProperty owner;
    private final StringProperty accountNumber;
    private final DoubleProperty balance;
    private final StringProperty date;

    public Account() {
        this.owner = new SimpleStringProperty(this, "owner", "");
        this.accountNumber = new SimpleStringProperty(this, "accountNumber", "");
        this.balance = new SimpleDoubleProperty(this, "balance", 0.0);
        this.date = new SimpleStringProperty(this, "dateCreated", "");
    }

    public Account(String owner, String accountNumber, double balance, String dateCreated) {
        this.owner = new SimpleStringProperty(this, "owner", owner);
        this.accountNumber = new SimpleStringProperty(this, "accountNumber", accountNumber);
        this.balance = new SimpleDoubleProperty(this, "balance", balance);
        this.date = new SimpleStringProperty(this, "dateCreated", dateCreated);
    }

    public String getOwner() {
        return owner.get();
    }

    public void setOwner(String owner) {
        this.owner.set(owner);
    }

    public StringProperty ownerProperty() {
        return owner;
    }

    public String getAccountNumber() {
        return accountNumber.get();
    }

    public void setAccountNumber(String accountNumber) {
        this.accountNumber.set(accountNumber);
    }

    public StringProperty accountNumberProperty() {
        return accountNumber;
    }

    public double getBalance() {
        return balance.get();
    }

    public void setBalance(double balance) {
        this.balance.set(balance);
    }

    public DoubleProperty balanceProperty() {
        return balance;
    }

    public String getDateCreated() {
        return date.get();
    }

    public void setDateCreated(String dateCreated) {
        this.date.set(dateCreated);
    }

    public StringProperty dateCreatedProperty() {
        return date;
    }


}
